<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<%@include file="/common/taglibs.jsp" %>
<%@include file="/common/javascript.jsp" %>
<html>
<head>
	<meta charset="UTF-8">
	<title>房地产信息管理系统</title>
	
	<style type="text/css">
		/* 顶部 */ 
		.l-topmenu{ margin:0; padding:0; height:68px; line-height:24px; border-top:1px solid #7C96AF;}
		.l-topmenu-logo{ color:#070A0C;  padding-left:30px; padding-top:20px;}
		.l-topmenu-welcome{  position:absolute; height:24px; right:30px; top:0px;color:#FFFFFF; padding-top:25px;}
		.l-topmenu-welcome a{text-decoration:none}
		.l-topmenu-welcome a:hover{color:#1C5787;}
		.l-topmenu-username{ color:#070A0C; font-weight:bold;} 
	</style>
	<style type="text/css" media="print">
		.NoPrint{display: none;}
		#pr{
			width: 0px; 
		}
	</style>
	 <script  type="text/javascript">
		//tabid计数器，保证tabid不会重复
		var tabid=0;
		var tabList;
		$(document).ready(function (){
			tabList=$('#tabs');
			
			//捕捉tab关闭事件
			tabList.tabs({
			 	border:false,
				onClose:function(title){
					tabid--;
					tabList.tabs('select',tabid);
				}
			});
		
			//国内政策
			$("#statePolicy").bind('click',function(){
				addTab('国内政策','policyAction_toList?typeid=1','');
			});
			//地方政策
			$("#dfPolicy").bind('click',function(){
				addTab('地方政策','policyAction_toList?typeid=2','');
			});
			//用地计划
			$("#landPlan").bind('click',function(){
				addTab('用地计划','landAction_gotoLandPlanList','');
			});
			//土地出让
			$("#landGrant").bind('click',function(){
				addTab('土地出让','landAction_gotoLandGrantList','');
			});
			//土地成交
			$("#landTran").bind('click',function(){
				addTab('土地成交','landAction_gotoLandTranList','');
			});
			//市区统计
			$("#cityStatistics").bind('click',function(){
				addTab('市区数据统计','cityAction_toList','');
			});
			//行政区统计
			$("#regionStatistics").bind('click',function(){
				addTab('行政区数据统计','regionStatisticsAction_toList','');
			});
			//查看地图
			$("#viewMap").bind('click',function(){
				addTab('查看地图','mapAction_toList?viewType=','');
			});
			//用户管理
			$("#userManage").bind('click',function(){
				addTab('用户管理','manageAction_toList','');
			});
			//系统设置
			$("#sysManage").bind('click',function(){
				addTab('系统设置','ecityAction_toList','');
			});
		});
		
		//刷新tab
		function refreshTab(cfg){   
			var refresh_tab = cfg.tabTitle?tabList.tabs('getTab',
				cfg.tabTitle):tabList.tabs('getSelected');
			if(refresh_tab && refresh_tab.find('iframe').length > 0){ 
				var _refresh_ifram = refresh_tab.find('iframe')[0];   
				var refresh_url = cfg.url?cfg.url:_refresh_ifram.src;
				_refresh_ifram.contentWindow.location.href=refresh_url;  
			}
		}
		
		//添加tab
		function addTab(title,href,icon){
			if(tabList.tabs('exists',title)){
				//如果已经存在，则刷新tab
				tabList.tabs('select',title);
				refreshTab({tabTitle:title,url:href}); 
			}else{
				tabid++;
				var content;
				if (href){               
				    content='<iframe scrolling="no" frameborder="0" src="'+	
						href+'" style="width:100%;height:100%;overflow: hidden;margin-top:-5px;" target="_parent"></iframe>';
       			} else {   
            		content = '未实现';   
        		}   

				tabList.tabs('add',{
					title:title,
					content: content,
					iconCls:icon,
					closable: true
				});
			}
		}
		
		//修改密码
		function changePwd(){
			$("#openFrame")[0].src="manageAction_toChangePwdForm";
			$("#content").dialog({ title:'修改密码', width:400, height:300, closed:true, minimizable:true,modal:true,
				buttons:[{
					text:'保存',
					handler:function(){
						openFrame.window.saveInfo();
					}
				},{ 
					text:'关闭',
						handler:function(){
							$("#content").dialog('close');
						}
					}]
				});
			$("#content").dialog('open');
		}
		
		function changeCity(){
			$("#openFrame")[0].src="ecityAction_toList";
			$("#content").dialog({ title:'修改城市', width:300, height:200, closed:true, minimizable:true,modal:true,
				buttons:[{
					text:'保存',
					handler:function(){
						openFrame.window.saveInfo();
					}
				},{ 
					text:'关闭',
						handler:function(){
							$("#content").dialog('close');
						}
					}]
				});
			$("#content").dialog('open');
		}
		
		//退出
		function logout(){
			this.window.location.href="manageAction_logout";
		}
		
		function refreshCity(name,tr){
			$("#content").dialog('close');
			$("#curCity").html(name);
			$("#curBQ").html(tr);
		}
		
		function closeContent(){
			$("#content").dialog('close');
			this.window.location.href="manageAction_logout";
		}
	</script>
</head>
<body class="easyui-layout">
        <div data-options="region:'north'" style=" overflow:hidden;" class="NoPrint">
        	<div  style=" background:url('images/main/bg-1477x768.jpg'); overflow:hidden;">
        		<div id="topmenu" class="l-topmenu">
        			<div class="l-topmenu-logo"><img src="images/main/header-logo.png" /></div>
        			<div class="l-topmenu-welcome">
        				<span class="l-topmenu-username"> 当前城市：<a id="curCity" href="javascript:return;">${ecity.name }</a>   </span> 
            			<span class="l-topmenu-username">欢迎您： ${model.name }</span> 
            			[<a href="javascript:changePwd();">修改密码</a>] &nbsp;
            			[<a href="javascript:changeCity();">修改当前城市</a>] &nbsp;
            			[<a href="javascript:logout();">退出</a>] 
        			</div> 
        		</div>
        	</div>
        </div>
        <div id="pr" data-options="region:'west',split:false" style="width:200px; overflow:auto" class="NoPrint">
        	<div class="easyui-accordion" style=" height:300px;" data-options="border:false">
                  <div title="国内政策" data-options="iconCls:'icon-ok'" style="height:200px; overflow:hidden" >
                      <a class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-detail'" 
                          style="overflow:hidden; padding-left:25px; width:83%;" id="statePolicy">国内政策</a>
                      <a class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-detail'" 
                          style="overflow:hidden; padding-left:25px; width:83%;" id="dfPolicy">地方政策</a>
                  </div>
                  <div title="土地市场" data-options="iconCls:'icon-ok'"  style="display:none;">
                      <a class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-detail'" 
                          style="overflow:hidden; padding-left:25px; width:83%;" id="landPlan">用地计划</a>
                      <a class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-detail'" 
                          style="overflow:hidden; padding-left:25px; width:83%;" id="landGrant">土地出让</a>
                      <a class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-detail'" 
                          style="overflow:hidden; padding-left:25px; width:83%;" id="landTran">土地成交</a>
                  </div>
                  <div title="数据统计" data-options="iconCls:'icon-ok'"  style="display:none;">
                      <a class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-detail'" 
                          style="overflow:hidden; padding-left:25px;width:83%;" id="cityStatistics">市区数据统计</a>
                      <a class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-detail'" 
                          style="overflow:hidden; padding-left:25px; width:83%;" id="regionStatistics">行政区数据统计</a>
                  </div>
                  <div title="查看地图" data-options="iconCls:'icon-ok'"  style="display:none;">
                      <a class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-detail'" 
                          style="overflow:hidden; padding-left:25px; width:83%;" id="viewMap">查看地图</a>
                  </div>
                  <div title="用户管理" data-options="iconCls:'icon-ok',border:false"  style="display:none;">
                      <a class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-detail'" 
                          style="overflow:hidden; padding-left:25px; width:83%;" id="userManage">用户管理</a>
                  </div>
            </div>
        </div>
        <div data-options="region:'center'" id="tabs" class="easyui-tabs" style="overflow:hidden;" class="NoPrint">
        </div>
        <div data-options="region:'south'" style="height:30px;text-align: center;vertical-align: middle;" class="NoPrint">
        	<a id="curBQ" style="margin: 10px;"> ${ecity.remark }</a>
        </div>
        
        <div id="content" style="top: 100px;">
    		<iframe id="openFrame" name="openFrame" frameborder="0"  src="" style="width:100%;height:95%;"></iframe>
    	</div> 
</body>
</html>
